{% extends 'base.html' %}

{% block title %}个人资料 - {{ site_info.site_name }}{% endblock %}

{% block content %}
<div class="row justify-content-center">
    <div class="col-md-8">
        <div class="card">
            <div class="card-header bg-primary text-white">
                <h2 class="mb-0">个人资料</h2>
            </div>
            <div class="card-body">
                <div class="row">
                    <div class="col-md-4 text-center mb-4 mb-md-0">
                        <div class="mb-3">
                            <i class="fas fa-user-circle" style="font-size: 8rem; color: #6c757d;"></i>
                        </div>
                        <h4>{{ user.username }}</h4>
                        <p class="text-muted">加入于：{{ user.date_joined|date:"Y年m月d日" }}</p>
                    </div>
                    <div class="col-md-8">
                        <form method="post">
                            {% csrf_token %}
                            
                            <div class="mb-3">
                                <label for="{{ form.bio.id_for_label }}" class="form-label">{{ form.bio.label }}</label>
                                {{ form.bio }}
                                {% if form.bio.help_text %}
                                    <div class="form-text">{{ form.bio.help_text }}</div>
                                {% endif %}
                                {% if form.bio.errors %}
                                    <div class="invalid-feedback d-block">
                                        {% for error in form.bio.errors %}
                                            {{ error }}
                                        {% endfor %}
                                    </div>
                                {% endif %}
                            </div>
                            
                            <div class="mb-3">
                                <label for="{{ form.website.id_for_label }}" class="form-label">{{ form.website.label }}</label>
                                {{ form.website }}
                                {% if form.website.help_text %}
                                    <div class="form-text">{{ form.website.help_text }}</div>
                                {% endif %}
                                {% if form.website.errors %}
                                    <div class="invalid-feedback d-block">
                                        {% for error in form.website.errors %}
                                            {{ error }}
                                        {% endfor %}
                                    </div>
                                {% endif %}
                            </div>
                            
                            <div class="d-flex justify-content-end">
                                <button type="submit" class="btn btn-primary">
                                    <i class="fas fa-save me-1"></i> 保存资料
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 